<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>商品修改页面</title>
    <script src="/js/jquery-3.2.0.min.js"></script>
    <script src="/js/app.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <script src="/js/default.js"></script>
    {{--<script src="/js/jquery.uploadView.js"></script>--}}
    <script src="/js/jquery.uploadify.min.js"></script>
    <!-- Fonts -->
    {{--<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css" rel='stylesheet' type='text/css'>--}}
    <link href="https://fonts.googleapis.com/css?family=Lato:100,300,400,700" rel='stylesheet' type='text/css'>
    <!-- Styles -->
    <link href="/css/app.css" rel="stylesheet">
    <link href="/css/uploadify.css" rel="stylesheet">
    {{--<link href="{{ elixir('css/app.css') }}" rel="stylesheet"> --}}


    <style>
        body {
            font-family: 'Lato';
        }
        .fa-btn {
            margin-right: 6px;
        }
        .flashy {
            font-family: "Source Sans Pro", Arial, sans-serif;
            padding: 11px 30px;
            border-radius: 4px;
            font-weight: 100;
            position: fixed;
            bottom: 20px;
            right: 20px;
            font-size: 12px;
            color: #fff;
        }
        .navbar-nav li{
            float: left ; width: 50px;
        }
        .tianjia {
            width: 100%;  height: 50px;cursor:pointer; background-color: #ffffff; text-align: left; padding-left: 15px;font-weight: bold;
        }
        .files{
            position:absolute; left:202px; top:52px; heigth:26px;cursor:pointer;
            filter: Alpha(opacity=0);
            -moz-opacity:0;
            opacity:0;
        }
        #show img{
            width: 100px;
            height: 100px;;

        }
        /* .uploadify-queue{ display: none;
         }*/

    </style>
</head>
<body id="app-layout">
<div class="" style="min-height:1000px; background-color: #efefef; border: none;">
    <form class="form-horizontal" role="form" enctype="multipart/form-data" method="post" action="{{ url('/goods/modify') }}">
        @foreach($goodsinfo as $key => $gdsinfo)
        <nav class="navbar navbar-default" role="navigation" style="margin-bottom: 0;">
            <div class="navbar-header" style="float: left;">
                <a class="navbar-brand" href="#">《</a>
            </div>

            <div class=" navbar-collapse" id="bs-example-navbar-collapse-1" style="float: left;">
                <ul class="nav navbar-nav" style= "width: 300px;">
                    <li class="" style="width: 80%; text-align: center;">
                        <a href="#">修改商品信息</a>
                    </li>
                    <li class="" style="width: 20%; text-align: center; height: 40px; line-height: 40px;">
                        <button type="submit" class="btn btn-default" style="border: none;background-color:#f8f8f8;" onclick="this.form.submit()">保存</button>
                    </li>

                </ul>
            </div>
        </nav>
        <div class="" style="line-height:50px;height: 50px; padding-left: 15px; border: none; font-weight: bold; ">请填写基本资料</div>
        <div class="container" style="margin-top: 0px; background-color: #ffffff;">

            <div class="form-group" style="border-bottom: 1px solid #efefef ;">
                <label for="firstname" class="col-sm-2 control-label" style="float: left; height: 50px; line-height: 50px;">品牌名称</label>
                <div class="col-sm-10" style="float: left; width: 70%">
                    <input type="text" name="brand" class="form-control" style="height: 50px; line-height: 50px; border: none;" id="firstname" value="{{$gdsinfo->title}}">
                </div>
            </div>
            <div class="form-group" style="border-bottom: 1px solid #efefef ;">
                <label for="firstname" class="col-sm-2 control-label" style="float: left; height: 50px; line-height: 50px;">商品名称</label>
                <div class="col-sm-10" style="float: left; width: 70%">
                    <input type="text" name="title" class="form-control" style="height: 50px; line-height: 50px; border: none;" id="firstname" value="{{$gdsinfo->brand}}">
                </div>
            </div>
            <div class="form-group" style="border-bottom: 1px solid #efefef ;">
                <label for="firstname" class="col-sm-2 control-label" style="float: left; height: 50px; line-height: 50px;">商品价格</label>
                <div class="col-sm-10" style="float: left; width: 70%">
                    <input type="text" class="form-control" style="height: 50px; line-height: 50px; border: none;" id="firstname" placeholder="请填写商品价格">
                </div>
            </div>

          <div class="form-group" style="border-bottom: 1px solid #efefef ;">
                 <input type="button" onmousemove="f.style.pixelLeft=event.x-60;f.style.pixelTop=this.offsetTop;" value="添加图片" size="30" onclick="f.click()" class="tianjia">
                 <input type="file" id="f" onchange="txt.value=this.value" name="face" style="height:26px;" class="files"  size="1" hidefocus>
             </div>
            {{--<div class="form-group" style="border-bottom: 1px solid #efefef ;">
                <label for="lastname" class="col-sm-2 control-label" style="height: 50px; line-height: 50px;">选择商品图片</label>

            </div>--}}

            {{--  <div class="control-group js_uploadBox">
                  <div class="btn-upload">
                      <a href="javascript:void(0);"><i class="icon-upload"></i><span class="js_uploadText">上传</span>图片</a>
                      <input class="js_upFile" type="file" name="cover">
                  </div>

                  <div class="js_showBox "><img class="js_logoBox" src="" width="100px" ></div>
              </div>
      --}}

            <form>
                <div id="queue"></div>
                <input id="file_upload" name="file_upload" type="file" multiple>
            </form>
            {{-- <div id="queue"></div>
     <input id="file_upload" name="file_upload" type="file" multiple>--}}
            {{--<div id="file_upload"></div>
            <input type="button" value="上传" onclick="javascript:$('#file_upload').uploadify('upload','*')"/>--}}
            <div id="show"></div>
            <div class="form-group">
                <label for="lastname" class="col-sm-2 control-label" style="height: 50px; line-height: 50px; float: left;">完善商品信息</label>
                <div class="navbar-header" style="float: right;">
                    <a class="navbar-brand" href="#" style="color:#000000;">》</a>
                </div>
            </div>
            <input type="hidden" name="id" value="{{$gdsinfo->id}}">
            <input type="hidden" name="merchant_id" value="1">
            <input type="hidden" name="describe" value="1111111111111">
            @endforeach
        </div>
    </form>
</div>
</body>
<meta name="csrf_token" id="token" content="{{ csrf_token() }}">
<!-- JavaScripts -->

<script>
    /*$(".js_upFile").uploadView({
     uploadBox: '.js_uploadBox',//设置上传框容器
     showBox : '.js_showBox',//设置显示预览图片的容器
     width : 100, //预览图片的宽度，单位px
     height : 100, //预览图片的高度，单位px
     allowType: ["gif", "jpeg", "jpg", "bmp", "png"], //允许上传图片的类型
     maxSize :2, //允许上传图片的最大尺寸，单位M
     success:function(e){
     // $(".js_uploadText").text('更改');
     //alert('图片上传成功');
     }
     });*/
</script>
{{--'_token'     : "{{csrf_token()}}"--}}
<script type="text/javascript">
    <?php $timestamp = time();?>
    $(function() {
        setTimeout(function(){
            $('#file_upload').uploadify({
                'method'         : 'post',
                'auto': true,/*如果是自动上传,那上传按钮将没用了*/
                'formData'     : {
                    'timestamp' : '<?php echo $timestamp;?>',
                    'token'     : '<?php echo md5('unique_salt' . $timestamp);?>'
                },
                'swf'      : '/js/uploadify.swf',
                // 'uploader' : 'uploadify.php'
                'uploader' : '{{ url('/goods/upload') }}',
                /*'width': 100,
                 'height': 100,*/
                'uploadLimit'     : 3 ,
                'buttonText' : '选择商品图片',
                'onUploadSuccess' : function(file,data,response) {
                    imgObj = "<p><img src='"+data+"'> </p>";
                    $("#show").append(imgObj);
                }
            });
        },10);
    });
</script>
</body>
</html>
